<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="copyright" content="http://www.appcms.org" />
<script src="js/config.js"></script>
<script src="js/common.js"></script>
<script>
	function openmain(){
		if(typeof(localStorage['device']) != "undefined"){
			if (typeof(localStorage['config']) != "undefined") {
				eval(localStorage['config']);
			}
			
			var url = '';
			
			for (k in l_footer) {
				url = l_footer[k]['model'];
				break;
			}
			
			if(pattern_type == "simple"){
				localStorage['meun_simple'] = url;
				var w = window.innerWidth;
				var h = window.innerHeight;
				var wl = (w*80)/100;
				uexWindow.openPopover('menu', 0, 'menu.html', '', 0, 0, w, h, '', 0);
				uexWindow.open(url, "0", url+'.html', 0, '','','256');
				
			}else if (pattern_type == "winphone") {
				uexWindow.open('main_winphone', "0", 'main_winphone.html', 0, '', '', "4");
			}
			else {
				uexWindow.open(url, "0", url + '.html', 0, '', '', "4");
			}
			
		}else{
			uexWindow.open('main_welcome', "0", 'main_welcome.html', '0', '','','0');
		}
	}

	function welcomeOk(){
		openmain();
	}

	window.uexOnload = function(type){
		if (!type) {
			openmain();
			//当有推送消息来的时候，打开这个页面时会调用setPushFun方法
            uexWidget.setPushNotifyCallback("setPushFun");
		}
		uexWidget.setPushInfo("","");//绑定推送用户
	}
	
	function setPushFun(){
        uexWidget.cbGetPushInfo=function(opId,dataType,data){
			if(data){
				data=JSON.parse(data);
				var id = data['id'];
				var t = data['model'];
				var catid = data['catid'];

				if(t=='news'||t=='picture'||t=='video'){			
					localStorage[t+'_id']=id;
					localStorage[t+'_catid']=catid;
					
					uexWindow.open(t+'_show','0',t+'_show.html','2','', '',0);
				}else if(t=='company'){		
					localStorage['company_id']=id;
					localStorage['company_catid']=catid;
					uexWindow.open('company_show','0','company_show.html','2','', '',0);
				}else if(t=='app'){
					uexWindow.open('apps_'+id,'0','apps/'+id+'/index.html','2','', '',0);
				}else if(t=='appurl'){
					app(id,title);
				}else if(t=='url'){
					localStorage['browserurl']=data['url'];
					uexWindow.open('browser','0','browser.html','2','', '',4);
				}
			}
        }
        uexWidget.getPushInfo();
    }

	
</script>
</html>